#include "stdafx.h"
#include <fly\dp\creational\singleton\singleton.h>

using namespace fly::jld::dp;

namespace test
{
	namespace st
	{

		class concrete
			:protected singleton<concrete>
		{
			friend class singleton<concrete>;
		private:
			concrete()
			{
				cout<<"construct concrete singleton"<<endl;
			}
			~concrete()
			{
				cout<<"destruct concrete singleton"<<endl;
			}
		public:
			void do_work()
			{
				cout<<"do work"<<endl;
			}
		};

	}
}

using test::st::concrete;
TEST(singleton, concrete)
{
	singleton<concrete>::instance().do_work();
}